<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>



    <style>
        .center,
        .left,
        .right {
            float: left;
        }
        *{
            height: 100px;
            color: white;
            margin: 0; padding: 0;
        }




        /* 用这个div把主内容包起来之后,主内容就可使用margin空出两边的区域了 */
        .center {
            width: 100%;
        }
        .content {
            margin: 0 100px;
            background: #000;
        }

        .left {
            width: 100px;
            background-color: red;
            margin-left: -100%;
        }
        .right {
            width: 100px;
            background-color: grey;
            margin-left: -100px;    
        }

        .footer {
            background-color: green;
            clear: both;
            /* 清除footer上面元素的浮动 */
        }
    </style>
    <header  style="background-color: darkgoldenrod;">header</header>


    <div class="center">
        <div class="content">center--content</div>
    </div>
    <div class="left">left</div>
    <div class="right">right</div>

    <div class="footer">footer</div>




	


<xmp style="font-size: 22px; font-weight: bolder;  margin-bottom: 66px;  color: black;  font-family: '微软雅黑';">
    
    必知必会        

    <div class="center">
        <div class="content">center--content</div>
    </div>
    <div class="left">left</div>
    <div class="right">right</div>

    <div class="footer">footer</div>

    .center {
        width: 100%;     => 设置为 100%
    }
    .content {
        margin: 0 100px;     =>  左右空出 100px 的距离
        background: #000;
    }

    .left {
        width: 100px;
        background-color: red;
        margin-left: -100%;      =>  向左移动 100% 个身位
    }
    .right {
        width: 100px;
        background-color: grey;
        margin-left: -100px;     =>  向左移动 100px  
    }
</xmp>

</body>

</html>